/**
 * @desc file类型转base64
 * @param {file} file 
 * @returns {string} 返回转换后的base64
 */
export function getBase(file) {
  return new Promise((resolve, reject) => {
    const reader = new FileReader();
    reader.readAsDataURL(file);
    reader.onload = () => resolve(reader.result);
    reader.onerror = error => reject(error);
  });
}